﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-trasitional.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" href="/static/css/table.css"
			type="text/css"></link>
		<script type="text/javascript"
			src="/static/javascript/comm/comm.js">
		</script>
		<script type="text/javascript" src="/static/javascript/jquery-1.7.2.js"></script>
	</head>
	<!--以下3个js库必须按照顺序引入-->
	<!--vue脚本库-->
	<script type="text/javascript"
			src="/static/js/vue-3.2.4.global.js">
		<!--axios脚本库-->
	</script>
	<script type="text/javascript"
			src="/static/js/axios-0.18.0.min.js">
	</script>
	<!--我们自己封装的axios函数库 -->
	<script type="text/javascript"
			src="/static/js/axios-helper.js">
	</script>
	<body id="app">
		<form action="third_kind_register_success.html" method="post">
			<table width="100%">
				<tr>
					<td>
						<font color="black">您正在做的业务是：人力资源--客户化设置--人力资源档案管理设置--III级机构设置--III级机构添加
						</font>
					</td>
				</tr>
				<tr>
					<td align="right">
						<input type="button" @click="submit()" value="提交" class="BUTTON_STYLE1">
						<input type="button" value="返回" class="BUTTON_STYLE1"
							onclick="history.back();">
					</td>
				</tr>
			</table>

			<table width="100%" border="1" cellpadding=0 cellspacing=1
				bordercolorlight=#848284 bordercolordark=#eeeeee
				class="TABLE_STYLE1">
				<tr>
					<td width="19%" class="TD_STYLE1">
						I级机构名称
					</td>
					<td width="81%" class="TD_STYLE2">
						<select v-model="first" class="INPUT_STYLE1">
							<option v-for="fir in configFileFirstKindList" :value="fir">
								{{fir.firstKindName}}
							</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="19%" class="TD_STYLE1">
						II级机构名称
					</td>
					<td width="81%" class="TD_STYLE2">
						<select v-model="second" class="INPUT_STYLE1">
							<option v-for="sec in configFileSecondKindList" :value="sec">
								{{sec.secondKindName}}
							</option>
							 
						</select>
					</td>
				</tr>
				<tr>
					<td width="19%" class="TD_STYLE1">
						III级机构编号
					</td>
					<td width="81%" class="TD_STYLE2">
						<input type="text" class="INPUT_STYLE1" v-model="configFileThirdKind.thirdKindId" />
					</td>
				</tr>
				<tr>
					<td class="TD_STYLE1">
						III级机构名称
					</td>
					<td class="TD_STYLE2">
						<input type="text" class="INPUT_STYLE1" v-model="configFileThirdKind.thirdKindName" />
					</td>
				</tr>
				<tr>
					<td class="TD_STYLE1">
						销售责任人编号（多个编号之间请用"半角逗号"加"一个空格"隔开，如", "）
					</td>
					<td class="TD_STYLE2">
						<textarea rows="4" cols="120" class="TEXTAREA_STYLE1" v-model="configFileThirdKind.thirdKindSaleId"></textarea>
					</td>
				</tr>
				<tr>
					<td class="TD_STYLE1">
						是否为零售店（是/否）
					</td>
					<td class="TD_STYLE2">
					<select v-model="configFileThirdKind.thirdKindIsRetail">
						<option selected="selected">是</option>
						<option>否</option>
					</select>
						 
					</td>
				</tr>
			</table>
		</form>
	</body>
	<script type="module">
		Vue.createApp({
			data(){
				return{
					//一级机构设置对象数组
					configFileFirstKindList:[],
					//二级机构设置对象数组
					configFileSecondKindList:[],
					first:null,
					second:null,
					//添加对象
					configFileThirdKind:{
						//主键，自动增长列
						ftkid:null,
						//一级机构编号
						firstKindId:null,
						//一级机构名称
						firstKindName:null,
						//二级机构编号
						secondKindId:null,
						//二级机构名称
						secondKindName:null,
						//三级机构编号
						thirdKindId:null,
						//三级机构名称
						thirdKindName:null,
						//三级机构销售责任人编号
						thirdKindSaleId:null,
						//三级机构是否为零售店  （是/否
						thirdKindIsRetail:null
					}
				}
			},
			methods:{
				submit(){

					this.configFileThirdKind.firstKindId=this.first.firstKindId;
					this.configFileThirdKind.secondKindId=this.second.secondKindId;
					this.configFileThirdKind.firstKindName=this.first.firstKindName;
					this.configFileThirdKind.secondKindName=this.second.secondKindName;
					console.info(this.configFileThirdKind);
					//保存三级机构设置对象
					requestPostman("/configFileThirdKind/save",this.configFileThirdKind).then((data)=>{
						if(data.statusCode==1){
							window.location.href="/templates/page/client/third_kind_register_success.html";
						}else{
							alert("添加失败");
						}
					})
				}
			},
			created(){
				requestGet("/configFileFirstKind/queryList").then((data)=>{
					console.info(data);
					this.configFileFirstKindList=data;
				}),
				requestGet("/configFileSecondKind/queryList").then((data)=>{
					console.info(data);
					this.configFileSecondKindList=data;
				})

			}
		}).mount("#app");
	</script>
</html>